export default class ObjectsUtils{

    /**
     * 深拷贝
     * @param object 拷贝对象
     * @return {*[]|{}|*}
     */
    static deepCopy(object) {
        if (typeof object !== 'object' || object === null) {
            return object;
        }

        const copy = Array.isArray(object) ? [] : {};

        for (let key in object) {
            if (object.hasOwnProperty(key)) {
                copy[key] = this.deepCopy(object[key]);
            }
        }

        return copy;
    }
}
